// MESSAGE ACC_CALIB support class

#pragma once

namespace mavlink {
namespace rams_msg {
namespace msg {

/**
 * @brief ACC_CALIB message
 *
 * Test all field types
 */
struct ACC_CALIB : mavlink::Message {
    static constexpr msgid_t MSG_ID = 920;
    static constexpr size_t LENGTH = 176;
    static constexpr size_t MIN_LENGTH = 176;
    static constexpr uint8_t CRC_EXTRA = 229;
    static constexpr auto NAME = "ACC_CALIB";


    double time; /*<  time */
    std::array<double, 9> mis_mat; /*<  Misalignment matrix */
    std::array<double, 9> scale_mat; /*<  Scale matrix */
    std::array<double, 3> bias_vec; /*<  Bias vector */


    inline std::string get_name(void) const override
    {
            return NAME;
    }

    inline Info get_message_info(void) const override
    {
            return { MSG_ID, LENGTH, MIN_LENGTH, CRC_EXTRA };
    }

    inline std::string to_yaml(void) const override
    {
        std::stringstream ss;

        ss << NAME << ":" << std::endl;
        ss << "  time: " << time << std::endl;
        ss << "  mis_mat: [" << to_string(mis_mat) << "]" << std::endl;
        ss << "  scale_mat: [" << to_string(scale_mat) << "]" << std::endl;
        ss << "  bias_vec: [" << to_string(bias_vec) << "]" << std::endl;

        return ss.str();
    }

    inline void serialize(mavlink::MsgMap &map) const override
    {
        map.reset(MSG_ID, LENGTH);

        map << time;                          // offset: 0
        map << mis_mat;                       // offset: 8
        map << scale_mat;                     // offset: 80
        map << bias_vec;                      // offset: 152
    }

    inline void deserialize(mavlink::MsgMap &map) override
    {
        map >> time;                          // offset: 0
        map >> mis_mat;                       // offset: 8
        map >> scale_mat;                     // offset: 80
        map >> bias_vec;                      // offset: 152
    }
};

} // namespace msg
} // namespace rams_msg
} // namespace mavlink
